import { RandomUtil } from "./../utils";

export class Group {

    title = 'new Collection';
    key = RandomUtil.generateUUID();
    isCurrent = false;
    children = [];

    constructor() { }

}

export class GroupChild {

    title = 'new Request';
    key = RandomUtil.generateUUID();
    parentKey;
    request = new IRequest();

    constructor(parentKey) {
        this.parentKey = parentKey;
    }
}

export class IRequest {

    isOpen = true;
    url = '';
    method = 'GET';
    headers;
    params;
    body = undefined;
    timeout = undefined;
    resBody = undefined;
    resStatus = undefined;

    constructor() { }

}

export class IParam {
    key = RandomUtil.generateUUID();
    name = '';
    value = '';
    description;
    isChecked = true;
    constructor() { }
}

// groupRules type group
export const GlobalRulesConfig = {
    groupRules: [],
    isGlobalOpen: false,
    selectedNode: null,
}
